import React, { Component } from "react";
import "./index.scss";
import * as api from "api/index";

class Browse extends Component {
  constructor(props) {
    super(props);
    this.state = {
      list: [
        // {
        //   id: "9a3f31c0-acdf-11ec-ba5b-3bb17d65f78f",
        //   imageUrl:
        //     "https://img.villaday.com/images/house_392/88870280/88870280-10-14757134.jpg",
        //   name: "大鹏古城·​千语居7房客栈",
        //   showMinAverage: "219",
        //   showMinPrice: "3288",
        // },
      ],
    };
  }

  componentDidMount() {
    this.getList();
  }

  getList() {
    api.$loveList().then((res) => {
      this.setState({
        list: res.result,
      });
    });
  }

  render() {
    return (
      <ul className="list my-love">
        {this.state.list.map((item) => (
          <li className="item pl-10 pr-10 bg-fff flex jc-sb aic">
            <img
              src={item.imageUrl}
              alt=""
            />
            <div className="t-box fg1 ml-15 f14 pt-15 fdc jc-c">
              <p className="bold lh15">{item.name}</p> 
              <p className="mt-10">
                <span>¥{item.showMinPrice}</span>
                <span className="f888 ml-5">人均:{item.showMinAverage}</span>
              </p>
            </div>
          </li>
        ))}

        <li className="fcc f888" style={{ height: "50px" }}>
          没有更多数据了
        </li>
      </ul>
    );
  }
}

export default Browse;
